/**
 * lyy api 封装
 *
 * @Author:    lyy
 * @Date:      2024-11-12 22:01:35
 * @Copyright  lyy
 */
import {postRequest, getRequest, getDownload} from '/@/lib/axios.js';

export const fabricMaterialsApi = {

  /**
   * 分页查询  @author  lyy
   */
  queryPage : (param) => {
    return postRequest('/fabricMaterials/queryPage', param);
  },

  /**
   * 增加  @author  lyy
   */
  add: (param) => {
      return postRequest('/fabricMaterials/add', param);
  },

  /**
   * 修改  @author  lyy
   */
  update: (param) => {
      return postRequest('/fabricMaterials/update', param);
  },


  /**
   * 删除  @author  lyy
   */
  delete: (id) => {
      return getRequest(`/fabricMaterials/delete/${id}`);
  },

  /**
   * 批量删除  @author  lyy
   */
  batchDelete: (idList) => {
      return postRequest('/fabricMaterials/batchDelete', idList);
  },

  /**
   * 获取物料信息
   */
  MaterialInfo: (fabricMaterialCode) => {
    return getRequest(`/fabricMaterials/getFabricMaterials/${fabricMaterialCode}`);
  },

  /**
   * 获取所有的面料信息
   */
  queryAll : () => {
    return getRequest(`/fabricMaterials/queryAll`);
  },
  /**
   * 获取所有的面料编码
   */
  getAllFabricMaterialCode: () => {
    return getRequest(`/fabricMaterials/getAllMaterialsCode`);
  },
  getCode: (code) => {
    return getRequest(`/fabricMaterials/getCode/${code}`);
  },
  export:()=>{
    return getDownload('/fabricMaterials/export');
  }

};
